package cn.glutnn;

import java.util.Timer;
import java.util.TimerTask;

public class Test {
	
	int midTime = 0;

	public void abc() {
		Timer timer = new Timer();
		timer.schedule(new TimerTask() {
			public void run() {
				midTime++;
				System.out.println(midTime + "秒");
			}
		}, 5000, 1000);
	}
	
	
	public static void main(String[] args) {
		Test test = new Test();
		test.abc();
	}
}
